Skip to content

Show the real default in the generated parent_controller comment - #5885

Open
farisbasha wants to merge 1 commit into
heartcombo:mainfrom
farisbasha:docs-parent-controller-default
Open

farisbasha wants to merge 1 commit into
heartcombo:mainfrom
farisbasha:docs-parent-controller-default

Conversation

@farisbasha

@farisbasha farisbasha commented Nov 18, 2026 •

Copy link
Copy Markdown

The generated initializer (lib/generators/templates/devise.rb) has this commented-out example:

# Configure the parent class to the devise controllers.
# config.parent_controller = 'DeviseController'

DeviseController is the class that uses this setting:

class DeviseController < Devise.parent_controller.constantize

so uncommenting the example as written would make DeviseController try to inherit from itself. The real default in lib/devise.rb is @@parent_controller = "ApplicationController".

This changes the comment to show 'ApplicationController', like the other commented settings in the template, which show their defaults. Comment-only change in the generator template; no behavior change.

An AI assistant helped find this and prepare the change.

The commented-out example in the generated initializer suggested
`config.parent_controller = 'DeviseController'`. DeviseController itself
inherits from `Devise.parent_controller.constantize`, so uncommenting
that line makes it try to inherit from itself. The default in
lib/devise.rb is "ApplicationController", so show that instead, like
the other commented settings in the template.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant